#include "app.h"

rint_buf_t ring_buf;

void cmd_event(void)
{

    if (strcmp((char *)ring_buf.buf,"led1_on") == 0)
    {
        led1_on();
        usart_sendstring(USARTx,(char *)ring_buf.buf);
        ring_buf_init(&ring_buf);
    }
    if (strcmp((char *)ring_buf.buf,"led1_off") == 0)
    {
        led1_off();
        usart_sendstring(USARTx,(char *)ring_buf.buf);
        ring_buf_init(&ring_buf);
    }
    
    if (strcmp((char *)ring_buf.buf,"led2_on") == 0)
    {
        led2_on();
        usart_sendstring(USARTx,(char *)ring_buf.buf);
        ring_buf_init(&ring_buf);
    }
    if (strcmp((char *)ring_buf.buf,"led2_off") == 0)
    {
        led2_off();
        usart_sendstring(USARTx,(char *)ring_buf.buf);
        ring_buf_init(&ring_buf);
    }
}


void button_single_click_callback_hamdle(void * para)
{
    led1_on();
}

void button_double_click_callback_hamdle(void * para)
{
    led1_off();
}
